<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
  <title>Document</title>
  <style>
    html, body {
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
    }
  </style>
  <!-- 引入刚刚下载的 ECharts 文件 -->
  <script src="./echarts/dist/echarts.js"></script>
</head>
<body>

<div id="main" style="width: 100vw;height:100vw;"></div>
<script>
var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);
var option;

option = {
  'color': ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'],
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      data: [820, 932, 901, 934, 1290, 1330, 1320],
      type: 'line',
      smooth: false,
      symbolSize: 14,
      symbol: 'circle',
      itemStyle: {
        color: (params)=>{
          console.log(params);
          return option.color[params.dataIndex];
        }
      },
      lineStyle: {
        color: "#aaa"
      }
    }
  ]
};

option && myChart.setOption(option);

</script>
</body>

</html>